<h2>站点列表</h2>

<table>
  <tr>
  <% for column in Site.content_columns %>
    <th><%= column.human_name %></th>
  <% end %>
  </tr>
  
<% for site in @sites %>
  <tr>
  <% for column in Site.content_columns %>
    <td><%=h site.send(column.name) %></td>
  <% end %>
    <td><%= link_to '显示', :action => 'show', :id => site %></td>
    <td><%= link_to '修改', :action => 'edit', :id => site %></td>
    <td><%= link_to '删除', { :action => 'destroy', :id => site }, :confirm => 'Are you sure?', :post => true %></td>
  </tr>
<% end %>
</table>

<%= link_to '上一页', { :page => @site_pages.current.previous } if @site_pages.current.previous %>
<%= link_to '下一页', { :page => @site_pages.current.next } if @site_pages.current.next %> 

<br />

<%= link_to '添加一个新站点', :action => 'new' %>
